package com.starlink.model.util;

import com.starlink.model.dtomapper.MallCategoryDtoMapper;
import com.starlink.model.domain.MallCategoryDO;
import com.starlink.model.vo.MallCategoryVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallCategoryConvert {

    public static List<MallCategoryVO> buildMallCategoryVoList(List<MallCategoryDO> mallCategoryDOList) {
        if (CollectionUtils.isEmpty(mallCategoryDOList)) {
            return Lists.newArrayList();
        }
        List<MallCategoryVO> mallCategoryVOList = new ArrayList<>();
        for (MallCategoryDO mallCategoryDO : mallCategoryDOList) {
            mallCategoryVOList.add(MallCategoryDtoMapper.INSTANCE.do2VO(mallCategoryDO));
        }

        return mallCategoryVOList;
    }
}
